<?php /* Smarty version Smarty-3.1.18, created on 2017-06-01 13:44:22
         compiled from "/data/www/mystery/protected/views/benchmark/duibiao.tpl" */ ?>
<?php /*%%SmartyHeaderCode:114017353954bfb77d583902-09413263%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    'a52abf90bc19693d2ddc2d5256443341d9a26671' => 
    array (
      0 => '/data/www/mystery/protected/views/benchmark/duibiao.tpl',
      1 => 1494904490,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '114017353954bfb77d583902-09413263',
  'function' => 
  array (
  ),
  'version' => 'Smarty-3.1.18',
  'unifunc' => 'content_54bfb77d5c3d05_60311034',
  'variables' => 
  array (
    'subject_info' => 0,
    'info' => 0,
    'attachlist' => 0,
    'val' => 0,
    'subject_id' => 0,
    'nq_id' => 0,
    'project' => 0,
    'network_id' => 0,
    'iframe' => 0,
    'referer' => 0,
  ),
  'has_nocache_code' => false,
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_54bfb77d5c3d05_60311034')) {function content_54bfb77d5c3d05_60311034($_smarty_tpl) {?><?php echo $_smarty_tpl->getSubTemplate ("../common/iframe_head.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>

<link href="/css/uploadify.css" rel="stylesheet">
<script src="/js/jquery.uploadify.min.js"></script>
<form name='myForm1' id='myForm1' method='post' action='/benchmark/DoDuibiao'>
    <div style='margin:10px;'>
        <table>
            <tr>
                <td><b>题目：</b></td>
                <td><b><?php echo $_smarty_tpl->tpl_vars['subject_info']->value['question_num'];?>
<?php echo $_smarty_tpl->tpl_vars['subject_info']->value['title'];?>
</b></td>
            </tr>
            <!--<tr>
                <td>是否申请还分：</td>
                <td><input name='isreturn' type='radio' value='0' <?php if ($_smarty_tpl->tpl_vars['info']->value['isreturn']==0) {?>checked="checked"<?php }?> />否
                    <input type="radio" name="isreturn" value="1" <?php if ($_smarty_tpl->tpl_vars['info']->value['isreturn']==1) {?>checked="checked"<?php }?> />是
                </td>
            </tr>-->
            <tr>
                <td>申诉内容：</td><td><textarea name='suggestion' cols='65' rows='10'><?php echo $_smarty_tpl->tpl_vars['info']->value['suggestion'];?>
</textarea></td>
            </tr>
            <tr>
                <td>附件：</td>
                <td><br/>
                    <input type='file' id="uploadify">(格式不限，总大小限制10M，上传速度与网速有关)
                    <?php if ($_smarty_tpl->tpl_vars['info']->value['haveattach']==1) {?>
                    <ul>
                    <?php  $_smarty_tpl->tpl_vars['val'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['val']->_loop = false;
 $_smarty_tpl->tpl_vars['key'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['attachlist']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['val']->key => $_smarty_tpl->tpl_vars['val']->value) {
$_smarty_tpl->tpl_vars['val']->_loop = true;
 $_smarty_tpl->tpl_vars['key']->value = $_smarty_tpl->tpl_vars['val']->key;
?>
                    <li id="attach_<?php echo $_smarty_tpl->tpl_vars['val']->value['qba_id'];?>
"><?php echo $_smarty_tpl->tpl_vars['val']->value['filename'];?>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="<?php echo $_smarty_tpl->tpl_vars['val']->value['url'];?>
" target="_blank">下载</a>&nbsp;<a href="javascript:;" onclick="del(<?php echo $_smarty_tpl->tpl_vars['val']->value['qba_id'];?>
);">删除</a></li>
                    <?php } ?>
                    </ul>
                    <?php }?>
                </td>
            </tr>
            <tr><td colspan='2'><input type='submit' class="button" value='提交'></td></tr>
        </table>
            <input type='hidden' name='subject_id' value='<?php echo $_smarty_tpl->tpl_vars['subject_id']->value;?>
' />
        <input name='nq_id' type='hidden' value='<?php echo $_smarty_tpl->tpl_vars['nq_id']->value;?>
' />
        <input name='qb_id' type='hidden' value='<?php echo $_smarty_tpl->tpl_vars['info']->value['qb_id'];?>
' />
    </div>
</form>
    <script>
        var project_email = "超大文件上传请联系项目邮箱<?php echo $_smarty_tpl->tpl_vars['project']->value['email'];?>
";
        $(document).ready(function() {     
                var options = {         
                    beforeSubmit:  showRequest,  
                    success:       showResponse,
                    dataType:  'json'
                }
                $('#myForm1').ajaxForm(options); 
                
                
                $('#uploadify').uploadify({
                    'fileSizeLimit' : '10MB',
                    'formData'      : {'nq_id' : <?php echo $_smarty_tpl->tpl_vars['nq_id']->value;?>
, 'subject_id' : <?php echo $_smarty_tpl->tpl_vars['subject_id']->value;?>
,'network_id':<?php echo $_smarty_tpl->tpl_vars['network_id']->value;?>
},
                    'buttonText' : '选择文件',
                    'fileObjName' : 'upfile',   
                    'swf'      : '/js/uploadify.swf',
                    'fileTypeExts' : '*.*',
                    'uploader' : '/attachment/duibiaoAttach?attach_type=benchmark',
                    'onUploadSuccess' : function(file, data, response) {
                        var obj = eval('(' + data + ')');
                        if (obj.state =='SUCCESS'){
                            alert('上传成功');
                        } else {
                            alert(obj.note);
                        }
                    } 
                });   
        });
            function showRequest(formData, jqForm, options) { 
                return true;
            }
            function showResponse(responseText, statusText, xhr, $form)  { 
                alert(responseText.note);
                if (responseText.status==1) {
                    window.parent.thisPage = false;
                    <?php if ($_smarty_tpl->tpl_vars['iframe']->value==1) {?>
                    window.parent.location.reload();
                    <?php } else { ?>
                    window.parent.location.href='<?php echo $_smarty_tpl->tpl_vars['referer']->value;?>
&subject_id=<?php echo $_smarty_tpl->tpl_vars['subject_info']->value['subject_id'];?>
';
                    <?php }?>
                }
            }
            //删除附件
            function del(qba_id){
                if (confirm('确定删除此附件！')) {
                    $.getJSON('/benchmark/DelBenchAttach',{qba_id:qba_id},function(res){
                        if (res.status==1) {
                            $('#attach_'+qba_id).remove();
                        }
                        alert(res.note);
                    });
                }
            }
    </script>
<?php echo $_smarty_tpl->getSubTemplate ("../common/footer.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>
<?php }} ?>
